Xbasic
- (Time Subtraction)
Syntax
Result as D = Operand1 as Y - Seconds as N
Seconds as N = Operand1 as Y - Operand2 as Y
Arguments
- Operand1
A short time value.
- Operand2
A short time value.
- Seconds
A number.
Description
Time subtraction produces a short time value or number by subtracting an integral or fractional number of Seconds from Operand1.
Examples:
The following example shows how to modify a time variable (type Y) by subtracting seconds.
dim t2 as Y t2 = ctot("12:40") ? t2 = 12:40:00 00 pm t2 = t2 - 60 ? t2 = 12:39:00 00 pm
The following example shows that you can subtract one time variable from another to find the elapsed time.
dim t1 as Y dim t2 as Y t1 = ctot("11:10") t2 = ctot("12:40") ? (t2 - t1)/60 = 90
See Also